package cn.springspace.kotlinapp.model

import kotlinx.serialization.Serializable
import lombok.Data
import javax.persistence.Embeddable

@Embeddable
@Data
@Serializable
 class DoorEventKey(var eventId: String = "", var doorIndexCode: String = "") : java.io.Serializable {

    fun DoorEventKey(eventId: String, doorIndexCode: String) {
        this.eventId = eventId
        this.doorIndexCode = doorIndexCode
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as DoorEventKey

        if (eventId != other.eventId) return false
        if (doorIndexCode != other.doorIndexCode) return false

        return true
    }

    override fun hashCode(): Int {
        var result = eventId.hashCode()
        result = 31 * result + doorIndexCode.hashCode()
        return result
    }


}